﻿Public Class frmMain
    Dim kqDangNhap As Boolean = False

    Private Sub KT_DangNhap_DangXuat()
        frmDangNhap.ShowDialog()
        kqDangNhap = frmDangNhap.kqDangNhap
        If kqDangNhap Then
            mntChucNang.Enabled = True
            mntQuanLy.Enabled = True
            ttpDangNhap.Visible = False
            ttpDangXuat.Visible = True
        Else
            '.....
        End If
    End Sub

    Private Sub DangXuat()
        mntChucNang.Enabled = False
        mntQuanLy.Enabled = False
        ttpDangNhap.Visible = True
        ttpDangXuat.Visible = False
    End Sub
    Private Sub ttpDangNhap_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ttpDangNhap.Click
        KT_DangNhap_DangXuat()
    End Sub

    Private Sub ttpDangXuat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ttpDangXuat.Click
        DangXuat()
    End Sub


    Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        KT_DangNhap_DangXuat()
    End Sub

    Private Sub XeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles XeToolStripMenuItem.Click

        frmQuanLyXE.MdiParent = Me
        frmQuanLyXE.Show()
    End Sub

    Private Sub GánXeVàoTuyếnToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GánXeVàoTuyếnToolStripMenuItem.Click

        frmGanXe.MdiParent = Me
        frmGanXe.Show()
    End Sub

    Private Sub BánVeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BánVeToolStripMenuItem.Click
        frmBanVe.MdiParent = Me
        frmBanVe.Show()
    End Sub

    Private Sub CậpNhậtGiáVéToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CậpNhậtGiáVéToolStripMenuItem.Click
        frmLoaiVe.MdiParent = Me
        frmLoaiVe.Show()
    End Sub

    Private Sub TuyếnXeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TuyếnXeToolStripMenuItem.Click
        frmTuyenXe.MdiParent = Me
        frmTuyenXe.Show()
    End Sub

    Private Sub LịchGánToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LịchGánToolStripMenuItem.Click
        frmQuanLyLichGan.MdiParent = Me
        frmQuanLyLichGan.Show()
    End Sub

 
    Private Sub LặpLịchTuyếnToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        frmLapLich.MdiParent = Me
        frmLapLich.Show()
    End Sub

 
    Private Sub ThoátToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ThoátToolStripMenuItem.Click
        Close()
    End Sub

    Private Sub ThôngTinCáNhânToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ThôngTinCáNhânToolStripMenuItem1.Click
        frmQuanLyNhanVien.MdiParent = Me
        frmQuanLyNhanVien.Show()
    End Sub
End Class